
def days_of_month(year, month):
    if month in (1, 3, 5, 7, 8, 10, 12):
        return 31
    elif month in (4, 6, 9, 11):
        return 30
    else:
        if year%400 == 0 or year%4 ==0  and year%100 != 0:
            return 29
        else: 
            return 28


days = 1
sundays = 0
for year in range(1900, 2001):
    for month in range(1, 13):
        if days % 7 == 0:
            if year > 1900:
                sundays += 1
        days += days_of_month(year, month) 

print sundays
